package homework02;

public class Demo {
    public static void main(String[] args) {
        Dog dog1 = new Dog("Buddy");
        Dog dog2 = new Dog("Buddy");
        Cat cat1 = new Cat("kitty");
        Cat cat2 = new Cat("kitty");

        System.out.println(dog1.toString());
        System.out.println(dog2.toString());
        System.out.println(cat1.toString());
        System.out.println(cat2.toString());

        System.out.println(dog1.makeSound());
        System.out.println(cat1.makeSound());

        System.out.println(dog1.equals(dog2));
        System.out.println(dog1.equals(cat1));
        System.out.println(cat1.equals(cat2));

        dog2.setName("Max");
        cat2.setName("Luna");
        System.out.println(dog1.equals(dog2)); // 输出：false
        System.out.println(cat1.equals(cat2)); // 输出：false

    }
}
